package com.tfswue.qmp.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;


//@Controller
//@ResponseBody     // 返回字符串以JSON字符串返回
@RestController   //组合注解，标注当前类是一个controller类，控制层，@ResponseBody注解（返回JSON数据），与@Controller注解组合
public class HelloController {
    @Value("${email}")
    private String email;

    @Value("${my1.email}")
    private String my1Email1;

    @Value("${city1[0]}")
    private String city1;

    @Value("${sxt[0].mobile}")
    private String mobile;

//    @RequestMapping("/hello")    //声明路径
//    public String hello() {
//
//        return "hello world";
//    }
        @RequestMapping("/hello")    //声明路径
    public String hello() {

        return "配置好热部署之后的显示信息";
    }



    @RequestMapping("/email")
    public String email() {
        return email;
    }

    @RequestMapping("/getvalue")
    public String getvalue() {
        return email+";"+my1Email1+";"+city1+";"+mobile;
    }
}
